package co.yixiang.modules.qeCode.enums;

import co.yixiang.modules.qeCode.enums.operation.QrCodeAction;
import co.yixiang.modules.qeCode.enums.operation.ext.CardScanAction;
import co.yixiang.modules.qeCode.enums.operation.ext.MarketingAction;
import co.yixiang.modules.qeCode.enums.operation.ext.ChannelAction;
import co.yixiang.modules.qeCode.enums.operation.ext.CityPartnerAction;
import co.yixiang.modules.qeCode.enums.operation.res.QrCodeResult;
import co.yixiang.modules.qeCode.param.QrCodeParam;
import co.yixiang.utils.BeanUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单类型相关枚举
 */
@Getter
@AllArgsConstructor
public enum QrCodeActionEnum {

	/**
	 * 城市合伙人
	 */
	CITY_PARTNER("城市合伙人","/pages/CityPartnerAction", CityPartnerAction.class),

	/**
	 * 渠道
	 */
	CHANNEL("渠道","/pages/ChannelAction", ChannelAction.class),

	/**
	 * 营销
	 */
	MARKETING("营销","/pages/MarketingAction", MarketingAction.class),

	/**
	 * 实体卡扫码
	 */
	CARD_SCAN("营销","/pages/MarketingAction", CardScanAction.class);

	private final String desc;

	private final String url;

	private final Class<? extends QrCodeAction> qrCodeAction;

	public QrCodeResult<?, ?> action(QrCodeParam param) {
		return BeanUtil.getBean(qrCodeAction).doAction(param, this);
	}


}